#include "core.h"
#include "GraphicsManager.h"
#include "LanguageManager.h"
#include "InputManager.h"
#include "FontManager.h"







CCore::CCore()
{

}

CCore::~CCore()
{
	//DeInit();
}

void CCore::Init(HWND hWnd, const SEngineParams& params)
{
	//Init Graphics
	m_GraphicsManager = new CGraphicsManager();
	assert(m_GraphicsManager);
	m_GraphicsManager->Init(hWnd, params);
	
	//Init Font Manager
	m_FontManager = new CFontManager();
	assert(m_FontManager);
	m_FontManager->Init(m_GraphicsManager);
	m_FontManager->LoadTTFs(params.m_FontsXMLPath);

	//Init Language Manager
	m_LanguageManager = new CLanguageManager();
	for(int i=0;i<params.m_LangXMLPathVector.size();++i)
	{
		m_LanguageManager->SetXmlFile(params.m_LangXMLPathVector[i]);
	}
	m_LanguageManager->LoadXMLs();
	m_LanguageManager->SetCurrentLanguage(params.m_CurrLanguage);
	
	//Init Input Manager
	m_InputManager = new CInputManager();
	m_InputManager->Init(hWnd,params.m_ScreenResolution,params.m_exclusiveMouse);

	

	//Init PhysX
	//Init Sound
}

void CCore::Deinit()
{
	CHECKED_DELETE(m_LanguageManager);
	CHECKED_DELETE(m_FontManager);
	CHECKED_DELETE(m_GraphicsManager);
	CHECKED_DELETE(m_InputManager);
}

void CCore::Update()
{	
	m_InputManager->Update();
	m_GraphicsManager->Update();
}

void CCore::Render()
{
	m_GraphicsManager->Render();
}




